import Vue from "vue";
import Router from "vue-router";


Vue.use(Router);

export default new Router({
  base: process.env.BASE_URL,
  routes: [{
      path: "/",
      name: "index",
      component: () =>
        import("./views/Home/index"),
      meta: {
        title: "",
        keepAlive: true // 不需要被缓存
      }
    },
    {
      path: "/order",
      name: "order",
      // route level code-splitting
      // this generates a separate chunk (about.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () =>
        import("./views/Order/index"),
      meta: {
        title: "订单",
        keepAlive: true // 不需要被缓存
      }
    },
    {
      path: "/user",
      name: "user",
      // route level code-splitting
      // this generates a separate chunk (about.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () =>
        import("./views/User/index"),
      meta: {
        title: "我的",
        keepAlive: true // 不需要被缓存
      }
    },
    {
      path: "/coupon",
      name: "coupon",
      // route level code-splitting
      // this generates a separate chunk (about.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () =>
        import("./views/User/coupon/index"),
      meta: {
        title: "我的优惠券",
        keepAlive: false // 不需要被缓存
      }
    },
    {
      path: "/mineralElement",
      name: "mineralElement",
      // route level code-splitting
      // this generates a separate chunk (about.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () =>
        import("./views/mineralElement/index"),
      meta: {
        title: "矿物元素",
        keepAlive: true // 不需要被缓存
      }
    },
    {
      path: "/paySuccess",
      name: "paySuccess",
      // route level code-splitting
      // this generates a separate chunk (about.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () =>
        import("./views/PaySuccess/index"),
      meta: {
        title: "支付成功",
        keepAlive: false // 不需要被缓存
      }
    }
  ]
});
